<script lang="ts">
export default {
  name: "XHomePage",
};
</script>
<script setup lang="ts">
import { ref } from "vue";
const list=ref<any>([])
const BalanceSheet=[
            {
                "YearEndPeriod":[
                    "(RMBMn)",
                    "12/2022",
                    "12/2021",
                    "12/2020",
                    "12/2019",
                    "12/2018"
                ],
                "@header":"1"
            },
            {
                "Fix_Ass":[
                    "Fixed Assets",
                    "104,336",
                    "106,550",
                    "94,385",
                    "78,070",
                    "47,801"
                ]
            },
            {
                "Invest":[
                    "Investments",
                    "651,034",
                    "766,890",
                    "684,297",
                    "432,437",
                    "364,704"
                ]
            },
            {
                "Curr_Ass":[
                    "Current Assets",
                    "565,989",
                    "484,812",
                    "317,647",
                    "253,968",
                    "217,080"
                ]
            },
            {
                "Other_Ass":[
                    "Other Assets",
                    "256,772",
                    "254,112",
                    "237,096",
                    "189,511",
                    "93,936"
                ]
            },
            {
                "Total_Ass":[
                    "Total Assets",
                    "1,578,131",
                    "1,612,364",
                    "1,333,425",
                    "953,986",
                    "723,521"
                ]
            },
            {
                "Total_Reserves":[
                    "Reserves",
                    "721,391",
                    "806,299",
                    "703,984",
                    "432,706",
                    "323,510"
                ]
            },
            {
                "Equity":[
                    "Equity",
                    "721,391",
                    "806,299",
                    "703,984",
                    "432,706",
                    "323,510"
                ]
            },
            {
                "Lt_Debt":[
                    "Long Term Debt",
                    "330,761",
                    "299,027",
                    "244,400",
                    "196,012",
                    "138,735"
                ]
            },
            {
                "Other_Liab":[
                    "Other Liabilities",
                    "91,775",
                    "103,940",
                    "115,962",
                    "85,112",
                    "58,841"
                ]
            },
            {
                "Curr_Liab":[
                    "Current Liabilities",
                    "434,204",
                    "403,098",
                    "269,079",
                    "240,156",
                    "202,435"
                ]
            },
            {
                "Major_Items":[
                    "Major Items(RMBMn)",
                    "12/2022",
                    "12/2021",
                    "12/2020",
                    "12/2019",
                    "12/2018"
                ],
                "@header":"1"
            },
            {
                "Inventory":[
                    "Inventory",
                    "2,333",
                    "1,063",
                    "814",
                    "718",
                    "324"
                ]
            },
            {
                "Cash":[
                    "Cash On Hand",
                    "292,634",
                    "273,746",
                    "255,486",
                    "201,082",
                    "163,322"
                ]
            },
            {
                "St_Debt":[
                    "Short Term Debt",
                    "17,934",
                    "24,449",
                    "18,064",
                    "36,508",
                    "40,554"
                ]
            },
            {
                "Total_Debt":[
                    "Total Debt",
                    "348,695",
                    "323,476",
                    "262,464",
                    "232,520",
                    "179,289"
                ]
            },
            {
                "auditor":[
                    "Auditors' Opinion",
                    "Unqualified",
                    "Unqualified",
                    "Unqualified",
                    "Unqualified",
                    "Unqualified"
                ]
            }
        ]
const arr:any=[]
delete BalanceSheet[0]["@header"]
BalanceSheet.forEach((item:any,index:number)=>{
  const entries:any=Object.entries(item);
  arr.push({})
  const composedArr=[entries[0][0],...entries[0][1]]
  composedArr.forEach((value:any,index2:number)=>{
   const objKey= ["one","two","three","four","five","six","seven"]
    arr[index][objKey[index2]]=value
  })

})
list.value=arr;
</script>

<template>
  <div>
    <el-table :data="list" :show-header="false" style="width: 800px;" :border="false">
      <el-table-column >
        <template v-slot="{ row }">
          {{ row.one }}
        </template>
      </el-table-column>
      <el-table-column >
        <template v-slot="{ row }">
          {{ row.two }}
        </template>
      </el-table-column>
      <el-table-column >
        <template v-slot="{ row }">
          {{ row.three }}
        </template>
      </el-table-column>
      <el-table-column >
        <template v-slot="{ row }">
          {{ row.four }}
        </template>
      </el-table-column>
      <el-table-column >
        <template v-slot="{ row }">
          {{ row.five }}
        </template>
      </el-table-column>
      <el-table-column >
        <template v-slot="{ row }">
          {{ row.six }}
        </template>
      </el-table-column>
      <el-table-column >
        <template v-slot="{ row }">
          {{ row.seven }}
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<style lang="less" scoped></style>
